using System;
using System.Collections.Generic;
using System.Text;

namespace Log4MyNet
{
    public class MainLog:IDisposable
    {
        IWriter writer;
        
        public MainLog()
        {
            string logFilePath=AppDomain.CurrentDomain.SetupInformation.ApplicationBase + Properties.Settings.Default.LogFileName;

            switch (Properties.Settings.Default.LogMode.ToLower())
            {
                case "text":
                    writer = new Writer(logFilePath);
                    break;
                default:
                    throw new Exception("not implement");
            }
        }

        public void LogMsg(string msg)
        {
            writer.WriteLog(msg);
        }

        public void LogLineMsg(string msg)
        {
            writer.WriteLineLog(msg);
        }

        #region IDisposable Members

        public void Dispose()
        {
            writer.Dispose();
        }

        #endregion
    }
}
